<?php include "../config.php";?>
<?php
session_start();
?>
<!--/*验证码的session开始，如果不放在前面，有的服务器会出现警告*/-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>公有农垦公司集采系统注册</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/index.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="js/viewport.js"></script>
    <script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>
    <?/*layui部分框架*/?>
    <link href="/application/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script src="/application/layui/layui.js"></script>

    <script src="/application/laydate/laydate.js"></script>

    <style type="text/css">

        body{ background: url(../uploadfiles/bg.jpg) no-repeat}

        html{ width: 100%; height: 100%;}
        body{
            padding: 0; margin: 0; position: relative; width: 100%; height: 100%;;
        }
        #loginform{ width: 700px; margin: 50px auto;}
        #loginform ul{ background: #FFF; box-shadow: #ccc 0px 0px 10px; margin: 0; padding: 65px 60px ; list-style: none; overflow: hidden;}
        #loginform ul li{ margin-bottom: 20px;}
        #loginform ul li #submit{ background: #84b8f3; color: #FFF; width: 100%; margin: 0; padding: 0; height: 50px; border: none;font-size: 1.2em; font-family: "microsoft yahei"; cursor: pointer;}
    </style>
</head>

<body>

    <form id="loginform" name="loginform" class="layui-form" method="post" action="registercheck.php" enctype="multipart/form-data"   onsubmit="return validateForm()" >
        <ul>
            <li>
                <label class="layui-form-label">登陆账号</label>
                <div class="layui-input-block">
                    <input type="text" name="account" id="acount" required  lay-verify="required" placeholder="6-12位英文或数字组合" autocomplete="off" class="layui-input">
                </div>
            </li>
            <li>
                <label class="layui-form-label">登陆密码</label>
                <div class="layui-input-block">
                    <input type="password" name="password" id="password" required  lay-verify="required" placeholder="密码长度为6-12位"  autocomplete="off" class="layui-input">
                </div>
            </li>
            <li>
                <label class="layui-form-label">确认密码</label>
                <div class="layui-input-block">
                    <input type="password" name="repassword"  id="repassword" required  lay-verify="required" placeholder="再次输入密码" autocomplete="off" class="layui-input">
                </div>
            </li>
            <li>
                <label class="layui-form-label">公司名称</label>
                <div class="layui-input-block">
                    <input type="text" name="company" id="company" required  lay-verify="required" placeholder="请输入公司名称" autocomplete="off" class="layui-input">
                </div>
            </li>

            <li>
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-block">
                    <input type="text" name="email" id="email" required  lay-verify="required" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
                </div>
            </li>
            <li>
                <label class="layui-form-label">电话</label>
                <div class="layui-input-block">
                    <input type="text" name="phone" id="phone" required  lay-verify="required" placeholder="请输入电话" autocomplete="off" class="layui-input">
                </div>
            </li>
            <li>
                <label class="layui-form-label">相关证书</label>
                <div class="layui-input-block">
                   <input type="file"  lay-reqtext="请选择相关证书" name="images1" required  lay-verify="required"/>
                </div>
            </li>
            <li>
                <label class="layui-form-label">资质证明</label>
                <div class="layui-input-block">
                    <input type="file"  lay-reqtext="请选择资质证明" name="images2" required  lay-verify="required"/>
                </div>
            </li>
            <li>
                <label class="layui-form-label">营业执照</label>
                <div class="layui-input-block">
                    <input type="file"  lay-reqtext="请选择营业执照" name="images3" required  lay-verify="required"/>
                </div>
            </li>


            <li style="clear: both; border: none; padding: 0;">
                <input type="submit" name="submit" id='submit'  lay-submit lay-filter="formDemo" value="注　册" />
            </li>

            <li>
                <div class="item box">
                    <div class="noaccount" > <a href="index.php"> 用户登录 </a></div>
                </div>
            </li>
        </ul>

    </form>




    <script>
        function help(){
            alert('资料收集中！');
        }
    </script>



<script>
    function bangdingweixin(){
        alert("功能准备开发，敬请期待！")
    }
</script>

    <script>
        layui.use(['upload','form', 'element', 'layer'], function(){
            var $ = layui.jquery
                ,upload = layui.upload
                ,element = layui.element
                ,layer = layui.layer;
            //拖拽上传
            var form = layui.form;

            //监听提交
            form.on('submit(formDemo)', function(data){

                if($("#acount").val().length < 6){
                    alert("请输入6-12位的账号");
                    return false;
                }
                if($("#password").val().length < 6){
                    alert("请输入6位以上密码");
                    return false;
                }


                if($("#password").val() != $("#repassword").val()){
                    alert("二次密码不正确");
                    return false;
                }
                if(!check_hone($("#phone").val())){return false;}
                if(!check_email($("#email").val())){return false;}
                return true;
            });


        });
    </script>
<script type='text/javascript'>



    var sendYzm = false;
    function send_yzm(){
        if(sendYzm){return;}
        sendYzm = true;
        var phone = $("#phone").val();
        if(!check_hone(phone)){return false;}

        $.post("../backstage/login/register_yzm.php", { "phone" : phone} ,function(data){
            if(data.code == '1'){
                yzm_Interval();
            }else{
                sendYzm = false;
            }
            alert(data.msg);
        },'json');
    }

    function yzm_Interval(){
        var sendYzmTime = 5;
        var sendYzmVar = setInterval(function(){
            if(sendYzmTime == 0){
                clearInterval(sendYzmVar);
                sendYzm = false;
                $('#sendYzm').html("发送验证码");
            }else{
                $('#sendYzm').html("验证码发送中..."+ --sendYzmTime);
            }
        }, 1000);
    }

    function check_hone(phone){
        if(!(/^1[3456789]\d{9}$/.test(phone))){
            alert("手机号码有误，请重填");
            return false;
        }
        return true;
    }

    function check_email(email){
        var pattern = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
        strEmail = pattern.test(email);
        if (!strEmail) {
            alert("邮箱有误，请重填");
            return false;
        }
        return true;
    }

    function isEmpty(obj){
        if(typeof obj == "undefined" || obj == null || obj == ""){
            return true;
        }else{
            return false;
        }
    }

</script>
</body>
</html>